package com.jalarbee.stock.product.business;

import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.persistence.ManyToOne;
import org.hibernate.annotations.Columns;
import org.hibernate.annotations.Type;

@Embeddable
public class ProductItem {

    @Type(type = "com.jalarbee.core.types.QuantityType")
    @Columns(columns= {
        @Column(name="SIZE"),
        @Column(name="UNIT")
    })
    private Quantity quantity;

    @ManyToOne
    private Product product;

    public ProductItem() {
    }

    public ProductItem(Product product, Quantity quantity) {
        this.product = product;
        this.quantity = quantity;
    }

    public Product getProduct() {
        return product;
    }

    public void setProduct(Product product) {
        this.product = product;
    }

    public Quantity getQuantity() {
        return quantity;
    }

    public void setQuantity(Quantity quantity) {
        this.quantity = quantity;
    }
}
